<script type="text/javascript">
	//List Configuration
	$j("#list_surgery").jqGrid({
		url:'surgery/list',
		datatype:'json',
		mtype:'POST',
		colNames:['Nombre','Descripcion'],
		colModel:[
		          {name: 'surgery_name', index: 'surgery_name', width: 50, editable: true},		
		          {name: 'description', index: 'description', width: 80, editable: true}
		],
		pager:'#gridpager_surgery',
		loadtext: 'Cargando Cirugías ...',
		rowNum:10,
		rowList:[10],
		sortname:'surgery_name',
		sortorder:'asc',
		autowidth:true,
		viewrecords:true,
		onSelectRow:function(id){},
		editurl:'surgery/save',
		scrollOffset:0
		//caption:'Cirugias'
	});

	$j("#list_surgery").setGridHeight(220);
	
	//Form editing
	$j("#list_surgery").jqGrid('navGrid',
							'#gridpager_surgery',
							{
								edit:true,
								add:true,
								del:true,
								search:true
							},
							{
								closeAfterEdit:true,
								editCaption: "Modificar Cirugía"
							},
							{
								closeAfterAdd:true,
								addCaption: "Nueva Cirugía"
							},
							{
								msg: "¿Desea eliminar la cirugía seleccionada?",
								caption: "Eliminar Cirugía",
								width:300
							},
							{
								sopt:['eq','bw','ew','cn']
							});
</script>